package com.ck.master.service.impl;

import com.ck.master.converter.PowerPerformanceHistoryConvertor;
import com.ck.master.dao.PowerperformanceHistoryMapper;
import com.ck.master.model.PowerperformanceHistory;
import com.ck.master.service.PowerperformanceHistoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @Author yd
 * @Date 2018/12/21 17:21
 */
@Service
@Slf4j
public class PowerperformanceHistoryServiceImpl implements PowerperformanceHistoryService {

    @Autowired
    private PowerperformanceHistoryMapper powerperformanceHistoryMapper;

    @Override
    public void bacthSave(int countNum) {
        log.info("开始插入：{}",new Date());

        for (int i = 0; i< countNum; i++) {
            PowerperformanceHistory powerperformanceHistory = PowerPerformanceHistoryConvertor.generrator();
            powerperformanceHistoryMapper.insert(powerperformanceHistory);
            log.info("已插入=================>   "+ i) ;
        }
    }
}
